package rules;

import com.ruoyi.system.entity.SysEnvironmentPointVO;

<#list SysEnvironmentPointVOList as item >
    <#if item.lowQuota != -1>
        rule "environment-${item.id}-${item.lowQuota}"
            when
                $s : SysEnvironmentPointVO(av < ${item.lowQuota})
            then
                $s.setAlert(1);
                $s.setAlertType("低报");
            update($s);
        end
    </#if>
    <#if item.highQuota != -1>
        rule "environment-${item.id}-${item.highQuota}"
            when
                $s : SysEnvironmentPointVO(av > ${item.highQuota})
            then
                $s.setAlert(1);
                $s.setAlertType("高报");
            update($s);
        end
    </#if>
    <#if item.highAndMighty != -1>
        rule "environment-${item.id}-${item.highAndMighty}"
            when
                $s : SysEnvironmentPointVO(av > ${item.highAndMighty})
            then
                $s.setAlert(1);
                $s.setAlertType("高高报");
            update($s);
        end
    </#if>
</#list>
